Repository navigation
Conversation
An exhausted or unreachable secondary pool held the primary connection until it resolved, with no limit by default. The secondary is now acquired in a spawned task capped at 100ms, so a timed-out acquisition still finishes and fills the pool for later calls.
d7894db to
8148abe
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8148abe. Configure here.
| "timed out acquiring a secondary redis connection", | ||
| ); | ||
| None | ||
| } |
There was a problem hiding this comment.
Timeouts logged as Sentry errors
Medium Severity
A secondary acquisition timeout is the expected fallback when the pool is slow or exhausted, but this path logs with relay_log::error!, which Relay reports to Sentry. Under that load this can emit one Sentry event per request.
Reviewed by Cursor Bugbot for commit 8148abe. Configure here.
|
|
||
| let primary_connection = primary.get_boxed_connection(); | ||
| let secondary_connection = | ||
| tokio::time::timeout(SECONDARY_CONNECTION_TIMEOUT, secondary_task); |
There was a problem hiding this comment.
Unbounded secondary acquisition tasks
Medium Severity
The spawned secondary get_connection is not given its own deadline. After the caller times out, that task keeps waiting, and the default pool wait_timeout is None, so an exhausted secondary leaves one background waiter per request.
Reviewed by Cursor Bugbot for commit 8148abe. Configure here.


Bounds the dual client's wait for a secondary connection to 100ms, so an exhausted or unreachable secondary pool no longer holds the primary connection.
The secondary is acquired in a spawned task, so an acquisition that times out still finishes and fills the pool instead of being cancelled.